\(\int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx\) [272]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 29, antiderivative size = 268 \[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {(e+f x)^2 \arctan \left (e^{c+d x}\right )}{a d}-\frac {f^2 \arctan (\sinh (c+d x))}{a d^3}+\frac {i f^2 \log (\cosh (c+d x))}{a d^3}-\frac {i f (e+f x) \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^2}+\frac {i f (e+f x) \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{a d^2}+\frac {i f^2 \operatorname {PolyLog}\left (3,-i e^{c+d x}\right )}{a d^3}-\frac {i f^2 \operatorname {PolyLog}\left (3,i e^{c+d x}\right )}{a d^3}+\frac {f (e+f x) \text {sech}(c+d x)}{a d^2}+\frac {i (e+f x)^2 \text {sech}^2(c+d x)}{2 a d}-\frac {i f (e+f x) \tanh (c+d x)}{a d^2}+\frac {(e+f x)^2 \text {sech}(c+d x) \tanh (c+d x)}{2 a d} \]

[Out]

(f*x+e)^2*arctan(exp(d*x+c))/a/d-f^2*arctan(sinh(d*x+c))/a/d^3+I*f^2*ln(cosh(d*x+c))/a/d^3-I*f*(f*x+e)*polylog
(2,-I*exp(d*x+c))/a/d^2+I*f*(f*x+e)*polylog(2,I*exp(d*x+c))/a/d^2+I*f^2*polylog(3,-I*exp(d*x+c))/a/d^3-I*f^2*p
olylog(3,I*exp(d*x+c))/a/d^3+f*(f*x+e)*sech(d*x+c)/a/d^2+1/2*I*(f*x+e)^2*sech(d*x+c)^2/a/d-I*f*(f*x+e)*tanh(d*
x+c)/a/d^2+1/2*(f*x+e)^2*sech(d*x+c)*tanh(d*x+c)/a/d

Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 268, normalized size of antiderivative = 1.00, number of steps used = 13, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.345, Rules used = {5690, 4271, 3855, 4265, 2611, 2320, 6724, 5559, 4269, 3556} \[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {f^2 \arctan (\sinh (c+d x))}{a d^3}+\frac {(e+f x)^2 \arctan \left (e^{c+d x}\right )}{a d}+\frac {i f^2 \operatorname {PolyLog}\left (3,-i e^{c+d x}\right )}{a d^3}-\frac {i f^2 \operatorname {PolyLog}\left (3,i e^{c+d x}\right )}{a d^3}+\frac {i f^2 \log (\cosh (c+d x))}{a d^3}-\frac {i f (e+f x) \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^2}+\frac {i f (e+f x) \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{a d^2}-\frac {i f (e+f x) \tanh (c+d x)}{a d^2}+\frac {f (e+f x) \text {sech}(c+d x)}{a d^2}+\frac {i (e+f x)^2 \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x)^2 \tanh (c+d x) \text {sech}(c+d x)}{2 a d} \]

[In]

Int[((e + f*x)^2*Sech[c + d*x])/(a + I*a*Sinh[c + d*x]),x]

[Out]

((e + f*x)^2*ArcTan[E^(c + d*x)])/(a*d) - (f^2*ArcTan[Sinh[c + d*x]])/(a*d^3) + (I*f^2*Log[Cosh[c + d*x]])/(a*
d^3) - (I*f*(e + f*x)*PolyLog[2, (-I)*E^(c + d*x)])/(a*d^2) + (I*f*(e + f*x)*PolyLog[2, I*E^(c + d*x)])/(a*d^2
) + (I*f^2*PolyLog[3, (-I)*E^(c + d*x)])/(a*d^3) - (I*f^2*PolyLog[3, I*E^(c + d*x)])/(a*d^3) + (f*(e + f*x)*Se
ch[c + d*x])/(a*d^2) + ((I/2)*(e + f*x)^2*Sech[c + d*x]^2)/(a*d) - (I*f*(e + f*x)*Tanh[c + d*x])/(a*d^2) + ((e
 + f*x)^2*Sech[c + d*x]*Tanh[c + d*x])/(2*a*d)

Rule 2320

Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Dist[v/D[v, x], Subst[Int[FunctionOfExponentialFu
nction[u, x]/x, x], x, v], x]] /; FunctionOfExponentialQ[u, x] &&  !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; F
reeQ[{a, m, n}, x] && IntegerQ[m*n]] &&  !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x))*(F_)[v_] /; FreeQ[{a, b, c}, x
] && InverseFunctionQ[F[x]]]

Rule 2611

Int[Log[1 + (e_.)*((F_)^((c_.)*((a_.) + (b_.)*(x_))))^(n_.)]*((f_.) + (g_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(
f + g*x)^m)*(PolyLog[2, (-e)*(F^(c*(a + b*x)))^n]/(b*c*n*Log[F])), x] + Dist[g*(m/(b*c*n*Log[F])), Int[(f + g*
x)^(m - 1)*PolyLog[2, (-e)*(F^(c*(a + b*x)))^n], x], x] /; FreeQ[{F, a, b, c, e, f, g, n}, x] && GtQ[m, 0]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4265

Int[csc[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c +
 d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)/E^(I*k*Pi)]/(f*fz*I)), x] + (-Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*
Log[1 - E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x] + Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e
 + f*fz*x)/E^(I*k*Pi)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 4269

Int[csc[(e_.) + (f_.)*(x_)]^2*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[(-(c + d*x)^m)*(Cot[e + f*x]/f), x
] + Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Cot[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && GtQ[m, 0]

Rule 4271

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> Simp[(-b^2)*(c + d*x)^m*Cot[e
 + f*x]*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (Dist[b^2*d^2*m*((m - 1)/(f^2*(n - 1)*(n - 2))), Int[(c +
 d*x)^(m - 2)*(b*Csc[e + f*x])^(n - 2), x], x] + Dist[b^2*((n - 2)/(n - 1)), Int[(c + d*x)^m*(b*Csc[e + f*x])^
(n - 2), x], x] - Simp[b^2*d*m*(c + d*x)^(m - 1)*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x]) /; Free
Q[{b, c, d, e, f}, x] && GtQ[n, 1] && NeQ[n, 2] && GtQ[m, 1]

Rule 5559

Int[((c_.) + (d_.)*(x_))^(m_.)*Sech[(a_.) + (b_.)*(x_)]^(n_.)*Tanh[(a_.) + (b_.)*(x_)]^(p_.), x_Symbol] :> Sim
p[(-(c + d*x)^m)*(Sech[a + b*x]^n/(b*n)), x] + Dist[d*(m/(b*n)), Int[(c + d*x)^(m - 1)*Sech[a + b*x]^n, x], x]
 /; FreeQ[{a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]

Rule 5690

Int[(((e_.) + (f_.)*(x_))^(m_.)*Sech[(c_.) + (d_.)*(x_)]^(n_.))/((a_) + (b_.)*Sinh[(c_.) + (d_.)*(x_)]), x_Sym
bol] :> Dist[1/a, Int[(e + f*x)^m*Sech[c + d*x]^(n + 2), x], x] + Dist[1/b, Int[(e + f*x)^m*Sech[c + d*x]^(n +
 1)*Tanh[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && EqQ[a^2 + b^2, 0]

Rule 6724

Int[PolyLog[n_, (c_.)*((a_.) + (b_.)*(x_))^(p_.)]/((d_.) + (e_.)*(x_)), x_Symbol] :> Simp[PolyLog[n + 1, c*(a
+ b*x)^p]/(e*p), x] /; FreeQ[{a, b, c, d, e, n, p}, x] && EqQ[b*d, a*e]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \int (e+f x)^2 \text {sech}^2(c+d x) \tanh (c+d x) \, dx}{a}+\frac {\int (e+f x)^2 \text {sech}^3(c+d x) \, dx}{a} \\ & = \frac {f (e+f x) \text {sech}(c+d x)}{a d^2}+\frac {i (e+f x)^2 \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x)^2 \text {sech}(c+d x) \tanh (c+d x)}{2 a d}+\frac {\int (e+f x)^2 \text {sech}(c+d x) \, dx}{2 a}-\frac {(i f) \int (e+f x) \text {sech}^2(c+d x) \, dx}{a d}-\frac {f^2 \int \text {sech}(c+d x) \, dx}{a d^2} \\ & = \frac {(e+f x)^2 \arctan \left (e^{c+d x}\right )}{a d}-\frac {f^2 \arctan (\sinh (c+d x))}{a d^3}+\frac {f (e+f x) \text {sech}(c+d x)}{a d^2}+\frac {i (e+f x)^2 \text {sech}^2(c+d x)}{2 a d}-\frac {i f (e+f x) \tanh (c+d x)}{a d^2}+\frac {(e+f x)^2 \text {sech}(c+d x) \tanh (c+d x)}{2 a d}-\frac {(i f) \int (e+f x) \log \left (1-i e^{c+d x}\right ) \, dx}{a d}+\frac {(i f) \int (e+f x) \log \left (1+i e^{c+d x}\right ) \, dx}{a d}+\frac {\left (i f^2\right ) \int \tanh (c+d x) \, dx}{a d^2} \\ & = \frac {(e+f x)^2 \arctan \left (e^{c+d x}\right )}{a d}-\frac {f^2 \arctan (\sinh (c+d x))}{a d^3}+\frac {i f^2 \log (\cosh (c+d x))}{a d^3}-\frac {i f (e+f x) \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^2}+\frac {i f (e+f x) \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{a d^2}+\frac {f (e+f x) \text {sech}(c+d x)}{a d^2}+\frac {i (e+f x)^2 \text {sech}^2(c+d x)}{2 a d}-\frac {i f (e+f x) \tanh (c+d x)}{a d^2}+\frac {(e+f x)^2 \text {sech}(c+d x) \tanh (c+d x)}{2 a d}+\frac {\left (i f^2\right ) \int \operatorname {PolyLog}\left (2,-i e^{c+d x}\right ) \, dx}{a d^2}-\frac {\left (i f^2\right ) \int \operatorname {PolyLog}\left (2,i e^{c+d x}\right ) \, dx}{a d^2} \\ & = \frac {(e+f x)^2 \arctan \left (e^{c+d x}\right )}{a d}-\frac {f^2 \arctan (\sinh (c+d x))}{a d^3}+\frac {i f^2 \log (\cosh (c+d x))}{a d^3}-\frac {i f (e+f x) \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^2}+\frac {i f (e+f x) \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{a d^2}+\frac {f (e+f x) \text {sech}(c+d x)}{a d^2}+\frac {i (e+f x)^2 \text {sech}^2(c+d x)}{2 a d}-\frac {i f (e+f x) \tanh (c+d x)}{a d^2}+\frac {(e+f x)^2 \text {sech}(c+d x) \tanh (c+d x)}{2 a d}+\frac {\left (i f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,-i x)}{x} \, dx,x,e^{c+d x}\right )}{a d^3}-\frac {\left (i f^2\right ) \text {Subst}\left (\int \frac {\operatorname {PolyLog}(2,i x)}{x} \, dx,x,e^{c+d x}\right )}{a d^3} \\ & = \frac {(e+f x)^2 \arctan \left (e^{c+d x}\right )}{a d}-\frac {f^2 \arctan (\sinh (c+d x))}{a d^3}+\frac {i f^2 \log (\cosh (c+d x))}{a d^3}-\frac {i f (e+f x) \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{a d^2}+\frac {i f (e+f x) \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{a d^2}+\frac {i f^2 \operatorname {PolyLog}\left (3,-i e^{c+d x}\right )}{a d^3}-\frac {i f^2 \operatorname {PolyLog}\left (3,i e^{c+d x}\right )}{a d^3}+\frac {f (e+f x) \text {sech}(c+d x)}{a d^2}+\frac {i (e+f x)^2 \text {sech}^2(c+d x)}{2 a d}-\frac {i f (e+f x) \tanh (c+d x)}{a d^2}+\frac {(e+f x)^2 \text {sech}(c+d x) \tanh (c+d x)}{2 a d} \\ \end{align*}

Mathematica [A] (verified)

Time = 5.80 (sec) , antiderivative size = 530, normalized size of antiderivative = 1.98 \[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {\frac {\frac {(e+f x)^3}{f}+\frac {3 \left (1-i e^c\right ) (e+f x)^2 \log \left (1+i e^{-c-d x}\right )}{d}+\frac {6 i \left (i+e^c\right ) f \left (d (e+f x) \operatorname {PolyLog}\left (2,-i e^{-c-d x}\right )+f \operatorname {PolyLog}\left (3,-i e^{-c-d x}\right )\right )}{d^3}}{i+e^c}+\frac {3 d^2 e^2 x-12 f^2 x-3 \left (1+i e^c\right ) \left (d^2 e^2-4 f^2\right ) x+3 d^2 e f x^2+d^2 f^2 x^3+6 d e \left (1+i e^c\right ) f x \log \left (1-i e^{-c-d x}\right )+3 d \left (1+i e^c\right ) f^2 x^2 \log \left (1-i e^{-c-d x}\right )+\frac {3 \left (1+i e^c\right ) \left (d^2 e^2-4 f^2\right ) \log \left (i-e^{c+d x}\right )}{d}-6 e \left (1+i e^c\right ) f \operatorname {PolyLog}\left (2,i e^{-c-d x}\right )-6 \left (1+i e^c\right ) f^2 x \operatorname {PolyLog}\left (2,i e^{-c-d x}\right )-\frac {6 \left (1+i e^c\right ) f^2 \operatorname {PolyLog}\left (3,i e^{-c-d x}\right )}{d}}{d^2 \left (-i+e^c\right )}-x \left (3 e^2+3 e f x+f^2 x^2\right ) \text {sech}(c)-\frac {3 i (e+f x)^2}{d \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {12 i f (e+f x) \sinh \left (\frac {d x}{2}\right )}{d^2 \left (\cosh \left (\frac {c}{2}\right )+i \sinh \left (\frac {c}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )}}{6 a} \]

[In]

Integrate[((e + f*x)^2*Sech[c + d*x])/(a + I*a*Sinh[c + d*x]),x]

[Out]

-1/6*(((e + f*x)^3/f + (3*(1 - I*E^c)*(e + f*x)^2*Log[1 + I*E^(-c - d*x)])/d + ((6*I)*(I + E^c)*f*(d*(e + f*x)
*PolyLog[2, (-I)*E^(-c - d*x)] + f*PolyLog[3, (-I)*E^(-c - d*x)]))/d^3)/(I + E^c) + (3*d^2*e^2*x - 12*f^2*x -
3*(1 + I*E^c)*(d^2*e^2 - 4*f^2)*x + 3*d^2*e*f*x^2 + d^2*f^2*x^3 + 6*d*e*(1 + I*E^c)*f*x*Log[1 - I*E^(-c - d*x)
] + 3*d*(1 + I*E^c)*f^2*x^2*Log[1 - I*E^(-c - d*x)] + (3*(1 + I*E^c)*(d^2*e^2 - 4*f^2)*Log[I - E^(c + d*x)])/d
 - 6*e*(1 + I*E^c)*f*PolyLog[2, I*E^(-c - d*x)] - 6*(1 + I*E^c)*f^2*x*PolyLog[2, I*E^(-c - d*x)] - (6*(1 + I*E
^c)*f^2*PolyLog[3, I*E^(-c - d*x)])/d)/(d^2*(-I + E^c)) - x*(3*e^2 + 3*e*f*x + f^2*x^2)*Sech[c] - ((3*I)*(e +
f*x)^2)/(d*(Cosh[(c + d*x)/2] + I*Sinh[(c + d*x)/2])^2) + ((12*I)*f*(e + f*x)*Sinh[(d*x)/2])/(d^2*(Cosh[c/2] +
 I*Sinh[c/2])*(Cosh[(c + d*x)/2] + I*Sinh[(c + d*x)/2])))/a

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 549 vs. \(2 (248 ) = 496\).

Time = 9.47 (sec) , antiderivative size = 550, normalized size of antiderivative = 2.05

method result size
risch \(\frac {d \,x^{2} f^{2} {\mathrm e}^{d x +c}+2 d e f x \,{\mathrm e}^{d x +c}+d \,e^{2} {\mathrm e}^{d x +c}-2 i f^{2} x +2 f^{2} x \,{\mathrm e}^{d x +c}-2 i e f +2 e f \,{\mathrm e}^{d x +c}}{\left ({\mathrm e}^{d x +c}-i\right )^{2} d^{2} a}+\frac {i \ln \left (1-i {\mathrm e}^{d x +c}\right ) e f x}{a d}-\frac {i \ln \left (1+i {\mathrm e}^{d x +c}\right ) f^{2} x^{2}}{2 a d}+\frac {i f^{2} \ln \left (1+i {\mathrm e}^{d x +c}\right ) c^{2}}{2 d^{3} a}-\frac {2 c e f \arctan \left ({\mathrm e}^{d x +c}\right )}{a \,d^{2}}-\frac {2 f^{2} \arctan \left ({\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {e^{2} \arctan \left ({\mathrm e}^{d x +c}\right )}{a d}+\frac {c^{2} f^{2} \arctan \left ({\mathrm e}^{d x +c}\right )}{a \,d^{3}}-\frac {i \ln \left (1+i {\mathrm e}^{d x +c}\right ) e f x}{a d}-\frac {2 i f^{2} \ln \left ({\mathrm e}^{d x +c}\right )}{a \,d^{3}}+\frac {i \ln \left (1-i {\mathrm e}^{d x +c}\right ) f^{2} x^{2}}{2 a d}-\frac {i e f \operatorname {polylog}\left (2, -i {\mathrm e}^{d x +c}\right )}{a \,d^{2}}+\frac {i \ln \left (1-i {\mathrm e}^{d x +c}\right ) c e f}{a \,d^{2}}+\frac {i e f \operatorname {polylog}\left (2, i {\mathrm e}^{d x +c}\right )}{a \,d^{2}}-\frac {i \operatorname {polylog}\left (2, -i {\mathrm e}^{d x +c}\right ) f^{2} x}{a \,d^{2}}-\frac {i e f \ln \left (1+i {\mathrm e}^{d x +c}\right ) c}{d^{2} a}+\frac {i \operatorname {polylog}\left (2, i {\mathrm e}^{d x +c}\right ) f^{2} x}{a \,d^{2}}+\frac {i f^{2} \ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{a \,d^{3}}-\frac {i \ln \left (1-i {\mathrm e}^{d x +c}\right ) c^{2} f^{2}}{2 a \,d^{3}}+\frac {i f^{2} \operatorname {polylog}\left (3, -i {\mathrm e}^{d x +c}\right )}{a \,d^{3}}-\frac {i f^{2} \operatorname {polylog}\left (3, i {\mathrm e}^{d x +c}\right )}{a \,d^{3}}\) \(550\)

[In]

int((f*x+e)^2*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

(d*x^2*f^2*exp(d*x+c)+2*d*e*f*x*exp(d*x+c)+d*e^2*exp(d*x+c)-2*I*f^2*x+2*f^2*x*exp(d*x+c)-2*I*e*f+2*e*f*exp(d*x
+c))/(exp(d*x+c)-I)^2/d^2/a+I/a/d*ln(1-I*exp(d*x+c))*e*f*x-1/2*I/a/d*ln(1+I*exp(d*x+c))*f^2*x^2+1/2*I/a/d^3*ln
(1+I*exp(d*x+c))*c^2*f^2-2/a/d^2*c*e*f*arctan(exp(d*x+c))-2/a/d^3*f^2*arctan(exp(d*x+c))+1/a/d*e^2*arctan(exp(
d*x+c))+1/a/d^3*c^2*f^2*arctan(exp(d*x+c))-I/a/d*ln(1+I*exp(d*x+c))*e*f*x-2*I/a/d^3*f^2*ln(exp(d*x+c))+1/2*I/a
/d*ln(1-I*exp(d*x+c))*f^2*x^2-I/a/d^2*e*f*polylog(2,-I*exp(d*x+c))+I/a/d^2*ln(1-I*exp(d*x+c))*c*e*f+I/a/d^2*e*
f*polylog(2,I*exp(d*x+c))-I/a/d^2*polylog(2,-I*exp(d*x+c))*f^2*x-I/a/d^2*ln(1+I*exp(d*x+c))*c*e*f+I/a/d^2*poly
log(2,I*exp(d*x+c))*f^2*x+I/a/d^3*f^2*ln(1+exp(2*d*x+2*c))-1/2*I/a/d^3*ln(1-I*exp(d*x+c))*c^2*f^2+I*f^2*polylo
g(3,-I*exp(d*x+c))/a/d^3-I*f^2*polylog(3,I*exp(d*x+c))/a/d^3

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 805 vs. \(2 (235) = 470\).

Time = 0.25 (sec) , antiderivative size = 805, normalized size of antiderivative = 3.00 \[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {-4 i \, d e f + 4 i \, c f^{2} - 2 \, {\left (i \, d f^{2} x + i \, d e f + {\left (-i \, d f^{2} x - i \, d e f\right )} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, {\left (d f^{2} x + d e f\right )} e^{\left (d x + c\right )}\right )} {\rm Li}_2\left (i \, e^{\left (d x + c\right )}\right ) - 2 \, {\left (-i \, d f^{2} x - i \, d e f + {\left (i \, d f^{2} x + i \, d e f\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d f^{2} x + d e f\right )} e^{\left (d x + c\right )}\right )} {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right ) - 4 \, {\left (i \, d f^{2} x + i \, c f^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d^{2} f^{2} x^{2} + d^{2} e^{2} + 2 \, d e f - 4 \, c f^{2} + 2 \, {\left (d^{2} e f - d f^{2}\right )} x\right )} e^{\left (d x + c\right )} + {\left (-i \, d^{2} e^{2} + 2 i \, c d e f - i \, c^{2} f^{2} + {\left (i \, d^{2} e^{2} - 2 i \, c d e f + i \, c^{2} f^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d^{2} e^{2} - 2 \, c d e f + c^{2} f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} + i\right ) + {\left (i \, d^{2} e^{2} - 2 i \, c d e f + {\left (i \, c^{2} - 4 i\right )} f^{2} + {\left (-i \, d^{2} e^{2} + 2 i \, c d e f + {\left (-i \, c^{2} + 4 i\right )} f^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, {\left (d^{2} e^{2} - 2 \, c d e f + {\left (c^{2} - 4\right )} f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - i\right ) + {\left (i \, d^{2} f^{2} x^{2} + 2 i \, d^{2} e f x + 2 i \, c d e f - i \, c^{2} f^{2} + {\left (-i \, d^{2} f^{2} x^{2} - 2 i \, d^{2} e f x - 2 i \, c d e f + i \, c^{2} f^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, {\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + 2 \, c d e f - c^{2} f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + {\left (-i \, d^{2} f^{2} x^{2} - 2 i \, d^{2} e f x - 2 i \, c d e f + i \, c^{2} f^{2} + {\left (i \, d^{2} f^{2} x^{2} + 2 i \, d^{2} e f x + 2 i \, c d e f - i \, c^{2} f^{2}\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d^{2} f^{2} x^{2} + 2 \, d^{2} e f x + 2 \, c d e f - c^{2} f^{2}\right )} e^{\left (d x + c\right )}\right )} \log \left (-i \, e^{\left (d x + c\right )} + 1\right ) - 2 \, {\left (i \, f^{2} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, f^{2} e^{\left (d x + c\right )} - i \, f^{2}\right )} {\rm polylog}\left (3, i \, e^{\left (d x + c\right )}\right ) - 2 \, {\left (-i \, f^{2} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, f^{2} e^{\left (d x + c\right )} + i \, f^{2}\right )} {\rm polylog}\left (3, -i \, e^{\left (d x + c\right )}\right )}{2 \, {\left (a d^{3} e^{\left (2 \, d x + 2 \, c\right )} - 2 i \, a d^{3} e^{\left (d x + c\right )} - a d^{3}\right )}} \]

[In]

integrate((f*x+e)^2*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x, algorithm="fricas")

[Out]

1/2*(-4*I*d*e*f + 4*I*c*f^2 - 2*(I*d*f^2*x + I*d*e*f + (-I*d*f^2*x - I*d*e*f)*e^(2*d*x + 2*c) - 2*(d*f^2*x + d
*e*f)*e^(d*x + c))*dilog(I*e^(d*x + c)) - 2*(-I*d*f^2*x - I*d*e*f + (I*d*f^2*x + I*d*e*f)*e^(2*d*x + 2*c) + 2*
(d*f^2*x + d*e*f)*e^(d*x + c))*dilog(-I*e^(d*x + c)) - 4*(I*d*f^2*x + I*c*f^2)*e^(2*d*x + 2*c) + 2*(d^2*f^2*x^
2 + d^2*e^2 + 2*d*e*f - 4*c*f^2 + 2*(d^2*e*f - d*f^2)*x)*e^(d*x + c) + (-I*d^2*e^2 + 2*I*c*d*e*f - I*c^2*f^2 +
 (I*d^2*e^2 - 2*I*c*d*e*f + I*c^2*f^2)*e^(2*d*x + 2*c) + 2*(d^2*e^2 - 2*c*d*e*f + c^2*f^2)*e^(d*x + c))*log(e^
(d*x + c) + I) + (I*d^2*e^2 - 2*I*c*d*e*f + (I*c^2 - 4*I)*f^2 + (-I*d^2*e^2 + 2*I*c*d*e*f + (-I*c^2 + 4*I)*f^2
)*e^(2*d*x + 2*c) - 2*(d^2*e^2 - 2*c*d*e*f + (c^2 - 4)*f^2)*e^(d*x + c))*log(e^(d*x + c) - I) + (I*d^2*f^2*x^2
 + 2*I*d^2*e*f*x + 2*I*c*d*e*f - I*c^2*f^2 + (-I*d^2*f^2*x^2 - 2*I*d^2*e*f*x - 2*I*c*d*e*f + I*c^2*f^2)*e^(2*d
*x + 2*c) - 2*(d^2*f^2*x^2 + 2*d^2*e*f*x + 2*c*d*e*f - c^2*f^2)*e^(d*x + c))*log(I*e^(d*x + c) + 1) + (-I*d^2*
f^2*x^2 - 2*I*d^2*e*f*x - 2*I*c*d*e*f + I*c^2*f^2 + (I*d^2*f^2*x^2 + 2*I*d^2*e*f*x + 2*I*c*d*e*f - I*c^2*f^2)*
e^(2*d*x + 2*c) + 2*(d^2*f^2*x^2 + 2*d^2*e*f*x + 2*c*d*e*f - c^2*f^2)*e^(d*x + c))*log(-I*e^(d*x + c) + 1) - 2
*(I*f^2*e^(2*d*x + 2*c) + 2*f^2*e^(d*x + c) - I*f^2)*polylog(3, I*e^(d*x + c)) - 2*(-I*f^2*e^(2*d*x + 2*c) - 2
*f^2*e^(d*x + c) + I*f^2)*polylog(3, -I*e^(d*x + c)))/(a*d^3*e^(2*d*x + 2*c) - 2*I*a*d^3*e^(d*x + c) - a*d^3)

Sympy [F]

\[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=- \frac {i \left (\int \frac {e^{2} \operatorname {sech}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f^{2} x^{2} \operatorname {sech}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {2 e f x \operatorname {sech}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \]

[In]

integrate((f*x+e)**2*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x)

[Out]

-I*(Integral(e**2*sech(c + d*x)/(sinh(c + d*x) - I), x) + Integral(f**2*x**2*sech(c + d*x)/(sinh(c + d*x) - I)
, x) + Integral(2*e*f*x*sech(c + d*x)/(sinh(c + d*x) - I), x))/a

Maxima [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 387, normalized size of antiderivative = 1.44 \[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {1}{2} \, e^{2} {\left (\frac {4 \, e^{\left (-d x - c\right )}}{-2 \, {\left (-2 i \, a e^{\left (-d x - c\right )} - a e^{\left (-2 \, d x - 2 \, c\right )} + a\right )} d} + \frac {i \, \log \left (e^{\left (-d x - c\right )} + i\right )}{a d} - \frac {i \, \log \left (i \, e^{\left (-d x - c\right )} + 1\right )}{a d}\right )} + \frac {-2 i \, f^{2} x - 2 i \, e f + {\left (d f^{2} x^{2} e^{c} + 2 \, e f e^{c} + 2 \, {\left (d e f + f^{2}\right )} x e^{c}\right )} e^{\left (d x\right )}}{a d^{2} e^{\left (2 \, d x + 2 \, c\right )} - 2 i \, a d^{2} e^{\left (d x + c\right )} - a d^{2}} - \frac {i \, {\left (d x \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right )\right )} e f}{a d^{2}} + \frac {i \, {\left (d x \log \left (-i \, e^{\left (d x + c\right )} + 1\right ) + {\rm Li}_2\left (i \, e^{\left (d x + c\right )}\right )\right )} e f}{a d^{2}} - \frac {2 i \, f^{2} x}{a d^{2}} - \frac {i \, {\left (d^{2} x^{2} \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + 2 \, d x {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right ) - 2 \, {\rm Li}_{3}(-i \, e^{\left (d x + c\right )})\right )} f^{2}}{2 \, a d^{3}} + \frac {i \, {\left (d^{2} x^{2} \log \left (-i \, e^{\left (d x + c\right )} + 1\right ) + 2 \, d x {\rm Li}_2\left (i \, e^{\left (d x + c\right )}\right ) - 2 \, {\rm Li}_{3}(i \, e^{\left (d x + c\right )})\right )} f^{2}}{2 \, a d^{3}} + \frac {2 i \, f^{2} \log \left (i \, e^{\left (d x + c\right )} + 1\right )}{a d^{3}} \]

[In]

integrate((f*x+e)^2*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x, algorithm="maxima")

[Out]

-1/2*e^2*(4*e^(-d*x - c)/((4*I*a*e^(-d*x - c) + 2*a*e^(-2*d*x - 2*c) - 2*a)*d) + I*log(e^(-d*x - c) + I)/(a*d)
 - I*log(I*e^(-d*x - c) + 1)/(a*d)) + (-2*I*f^2*x - 2*I*e*f + (d*f^2*x^2*e^c + 2*e*f*e^c + 2*(d*e*f + f^2)*x*e
^c)*e^(d*x))/(a*d^2*e^(2*d*x + 2*c) - 2*I*a*d^2*e^(d*x + c) - a*d^2) - I*(d*x*log(I*e^(d*x + c) + 1) + dilog(-
I*e^(d*x + c)))*e*f/(a*d^2) + I*(d*x*log(-I*e^(d*x + c) + 1) + dilog(I*e^(d*x + c)))*e*f/(a*d^2) - 2*I*f^2*x/(
a*d^2) - 1/2*I*(d^2*x^2*log(I*e^(d*x + c) + 1) + 2*d*x*dilog(-I*e^(d*x + c)) - 2*polylog(3, -I*e^(d*x + c)))*f
^2/(a*d^3) + 1/2*I*(d^2*x^2*log(-I*e^(d*x + c) + 1) + 2*d*x*dilog(I*e^(d*x + c)) - 2*polylog(3, I*e^(d*x + c))
)*f^2/(a*d^3) + 2*I*f^2*log(I*e^(d*x + c) + 1)/(a*d^3)

Giac [F]

\[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )}^{2} \operatorname {sech}\left (d x + c\right )}{i \, a \sinh \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((f*x+e)^2*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)^2*sech(d*x + c)/(I*a*sinh(d*x + c) + a), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {(e+f x)^2 \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int \frac {{\left (e+f\,x\right )}^2}{\mathrm {cosh}\left (c+d\,x\right )\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \]

[In]

int((e + f*x)^2/(cosh(c + d*x)*(a + a*sinh(c + d*x)*1i)),x)

[Out]

int((e + f*x)^2/(cosh(c + d*x)*(a + a*sinh(c + d*x)*1i)), x)